package com.example.fw;

import java.util.Properties;
import java.util.concurrent.TimeUnit;

public class ApplicationManager {
	
	public WebDriver driver;
	public String baseUrl;
	
	private Properties properties;
	
	public ApplicationManager(Properties properties) {
		this.properties = properties;
		String browser = properties.getProperty("browser");
		if ("firefox".equals(browser)) {
			driver = new FirefoxDriver();
		} else if ("ie".equals(browser)) {
			driver = new InternetExplorerDriver();
		} else {
			throw new Error("Unsupported browser: " + browser);
		}
		baseUrl = properties.getProperty("baseUrl");
		driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
		driver.get(baseUrl);
	}

	public void stop() {

	}
	
	
}
